Page({
    data: {
        tabs: [
            {
                id: 0,
                value: "商品收藏",
                isActive: true
            },
            {
                id: 1,
                value: "品牌收藏",
                isActive: false
            },
            {
                id: 2,
                value: "店铺收藏",
                isActive: false
            },
            {
                id: 2,
                value: "浏览足迹",
                isActive: false
            }
        ],
        collect: []
    },

    onLoad: function (options) {
    },

    onShow() {
        const collect = wx.getStorageSync('collect') || [];
        this.setData({collect});
    },

    handleTabItemChange(e) {
        const {index} = e.detail;
        const {tabs} = this.data;
        const newTabs = tabs.map((item, i) => ({...item, isActive: i === index}));
        this.setData({tabs: newTabs});
    },
})
